package com.xgkj.diyiketang.task;

import com.xgkj.diyiketang.http.CouponHttpRequest;
import com.xgkj.diyiketang.http.CouponHttpResponse;
import com.xgkj.diyiketang.http.engine.CouponHttpBaseTask;
import com.xgkj.diyiketang.http.engine.TaskResultCode;

/**
 * Created by windo on 16/5/12.
 */
public class LogoutTask extends CouponHttpBaseTask{
    public LogoutTask() {
        super(TaskType.LOGOUT_TASK);
    }

    @Override
    protected void prepareRequest() {
        super.prepareRequest();
        if (mPhase == TASK_PHASE_INIT){
            CouponHttpRequest request = new CouponHttpRequest(RequestType.LOGOUT_REQUEST);
            request.setApiNo(ApiNo.LOGOUT);
            addRequest(request);
        }
    }

    @Override
    protected void processResponseData(CouponHttpResponse response) {
        notifyTaskCompleted(TaskResultCode.SUCCESS,null);
    }
}
